package com.niiwoo.activity.stage.enums.mall;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Jaylin email yinjunling@niiwoo.com
 * @desc  新增的模块分类:理财卡券,热销商品  5.6.6版本
 * @date 2019/3/4
 */

@Getter
@AllArgsConstructor
public enum MallNewModuleEnum {

    FINANCIAL_MODULE((byte)1,"理财卡券"),
    GOODS_HOT_MODULE((byte)2,"热销商品"),
    ;
    private Byte code;
    private String desc;

    public static MallNewModuleEnum getModuleDesc(Byte code) {
        for (MallNewModuleEnum moduleEnum: MallNewModuleEnum.values()) {
            if(moduleEnum.getCode().equals(code)) {
                return moduleEnum;
            }
        }
        throw new NoSuchEnumValueException("MallNewModuleEnum:" + code);
    }
}
